/*
下次你路过,人间已无我
To the world , you will be a person , but to a person , you
will be the world .                               ——AKPower
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <cstdio>
#include <string>
#include <stack>
#include <set>
#define IOS ios::sync_with_stdio(false), cin.tie(0)
using namespace std;
typedef long long ll;

int main()
{
    IOS;
    ll a[4];
    cin>>a[0]>>a[1]>>a[2]>>a[3];
    if(a[0]+a[1]+a[2]<=a[3]){
        cout<<(a[0]+1)*(a[1]+1)*(a[2]+1)<<endl;
        return 0;
    }
    sort(a,a+3);
    ll sum=a[0]+a[1]+a[2];
    // ll ch=a+b+c-d;
    ll ans=0,ans_sum=(a[0]+1)*(a[1]+1)*(a[2]+1);
    for(ll i=a[0];i+a[1]+a[2]>a[3]&&i>=0;i--){
        ll ch=a[3]-i-a[1];
        if(ch<0){
            ll ch1=a[3]-i;
            if(ch1<0){
                ans+=(a[1]+1)*(a[2]+1);
            }
            else if(ch1==0){
                ans+=(a[1]+1)*(a[2]+1)-1;
            }
            else{
                ll ch3=a[1]-ch1;
                ans+=ch3*(a[2]+1);
                //a[2] a[2]-1 a[2]-2 ... a[2]-ch1
                ans+=(ch1+1)*(a[2]*2-ch1)/2;
            }
        }
        else if(ch==0){
            //a[2] a[2]-1 ... a[2]-a[1]
            ans+=(a[1]+1)*(a[2]*2-a[1])/2;
        }
        else {
            //a[2]-ch a[2]-ch-1 ... a[2]-ch-a[1]
            if(a[2]-ch>=a[1]+1){
                ans+=(a[1]+1)*(a[2]*2-ch*2-a[1])/2;
            }
            else {
                //a[2]-ch a[2]-ch-1 ...  1
                ans+=(a[2]-ch)*(a[2]-ch+1)/2;
            }
        }
    }
    cout<<ans_sum-ans<<endl;
    getchar();
    getchar();
    return 0;
}
